<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/templates/template.xhtml">

	<ui:define name="content">
		<h:form id="cadPromo">

			<p:panel id="Janela" header="Nova Promoção">

				<p:messages id="msgs" />

				<h:panelGrid columns="3">
					<h:outputText for="codigo" value="Codigo da promoção*:"></h:outputText>
					<p:inputText id="codigo" value="#{promocaoController.promocao.codPromocao}"
						required="true" label="Codigo">
						<f:validateLength minimum="3" />
					</p:inputText>
					<p:message for="codigo" display="icon" />

					<h:outputText for="validade" value="Valido até*:" />
					
					<p:calendar value="#{promocaoController.promocao.data}" id="validade" required="true" label="Validade">
						 <f:convertDateTime pattern="d/M/yyyy"/>  
					</p:calendar>  
					<p:message for="validade" display="icon" />

					<h:outputText for="desconto" value="Desconto*:"></h:outputText>
					<p:inputText id="desconto" value="#{promocaoController.promocao.desconto}"  required="true"
						label="Desconto">
						<f:validateLength minimum="5"></f:validateLength>
					</p:inputText>
					<p:message for="desconto" display="icon" />

					<h:outputText for="voo" value="Informe o código do voo* :"></h:outputText>
					<p:inputText id="voo" value="#{promocaoController.promocao.codVoo}"
						required="true" label="Voo">
						<f:validateLength minimum="5" />
					</p:inputText>
					<p:message for="voo" display="icon" />

				</h:panelGrid>

				<p:commandButton id="btn" value="Submeter" update="Janela"
					action="#{promocaoController.addPromocao}" />

			</p:panel>


		</h:form>

	</ui:define>

</ui:composition>
</html>